Motion sensors.
You’ve seen ‘em.
But have you ever wondered how they work?
There are several kinds out there but the most common one is the passive infrared sensor.
You might already know that these detect your body heat, but how does it do that?
And what’s going on inside here to, y’know, actually determine that something is moving and not just warm?
Like so many of the ubiquitous devices in our lives, the fundamental thing this is doing is incredibly simple.
But look at how all its pieces fit together and you’ll start to uncover something amazing.
First, let’s talk about you.
You’re glowing today!
Quite radiantly, I might add.
We all are!
In the infrared.
To quote some website I found,
“All matter with a temperature greater than absolute zero emits thermal radiation”
and we matter! And greater than absolute zero.
So our bodies radiate some infrared light.
Now, fun fact about infrared light, when it lands on stuff it heats that stuff up.
So you literally make everyone and everything around you just a little bit warmer simply by being there.
And that’s affirmative!
And also useful!
Because of a little phenomenon called pyroelectricity.
Turns out there are these crystals —
no not like that actual crystals —
which generate a little bit of voltage when they are heated up.
Gallium nitride is one such crystal.
It’s a really, really small effect producing only a wee bit of voltage so it’s not like they’re useful for doing work
but thanks to the extremely sensitive field-effect transistor or FET,
pyroelectric crystals can be used to detect changes in heat.
Hook one of these crystals up to the gate of a sufficiently sensitive transistor
and you can produce a large electrical signal when the crystal heats up even just a tiny little bit.
Since your body is constantly radiating infrared light, that means a pyroelectric crystal could be used to detect your presence.
Except… no.
If you glitched into existence right in front of a pyroelectric crystal
[fwoop] it would produce a blip of voltage as your body heat raised its temperature
but then… well it would stop.
It’s only the change in temperature that produces the voltage, otherwise we’d have something of a free energy device on our hands.
So once your body heat brought it to a new equilibrium temperature,
the voltage would go away.
But also, we don’t want that anyway.
Such a sensor would react to anything near it that quickly changes temperature - say a heater switching on.
And that’s not what we’re trying to detect.
But what if you had…
two of them?
If one crystal warmed up but the other didn’t,
there'd be an imbalance in voltage between the two which could be measured.
So if you can figure out a way to cause a person moving in front of a device with a pair of pyroelectric crystals to heat only one of them at a time,
you could detect that person’s movement.
Which brings us to these:
here I have two common types of passive infrared sensor, both used in lighting products.
The translucent piece of plastic you find on the front of both sensors is actually a complicated lens.
They look cloudy since they’re not transparent to visible light, but this material affects infrared light just as if it were glass.
And sitting behind the lens (quite far behind it as a matter of fact) is our pair of pyroelectric crystals.
They’re inside this metal can and hiding underneath a filter which rejects visible light so we can’t see them,
but I've got a Dremel tool with a cutoff wheel so that won’t stop me!
And what’s inside?
The letter H.
This may not look like much but this is in fact a pair of pyroelectric crystals.
OK, well the H isn’t - at least, I don’t think it is.
Full disclosure, I don’t really understand how this is constructed or indeed what the crystals are -
it may be gallium nitride, but it could be something else.
Pyroelectricity is exhibited in lots of stuff.
And I’m not even sure this is only two crystals.
If you look closely, you’ll see that there’s a translucent, vaguely shiny and stripy pattern on top of the H.
That could be a series of crystals, and my intuition tells me the H we see below them
is a printed pattern on their support which helps maximize the temperature differential between different areas of the crystal surface
by absorbing more IR in some spots and reflecting more in others.
I was looking through some data sheets for similar parts and this arrangement isn’t always the same,
which leads me to believe that the actual sensor element can be tuned for different applications.
Regardless of the specifics, look closely and you’ll see that the crystal is sort of floating above…
something.
So I broke it to see what that something was.
And it’s a small transistor package containing a FET.
Now that we can see everything, we can figure out how this component works.
Its three pins which attach it to a circuit board are labeled V, G, and S.
That’s voltage, ground, and signal.
Then if we look back at the component’s topside, we see that the voltage and signal pins are connected to the source and drain of the FET.
But the ground connection - that went to one side of the crystal element.
And, before I destroyed it, the other side of the crystal was connected to the gate of the FET.
Just like I said a few paragraphs ago!
Now, you might be a bit confused here because I said there were two crystals
and yet there’s only one structure connected to one transistor.
Well, here’s the really clever bit.
The two crystal elements found on this structure have opposite polarity.
While one produces a positive voltage, the other produces a negative voltage.
This means that if the whole structure heats up, while both crystals will produce some voltage, they perfectly oppose each other.
And the net effect is… nothing happens.
Why do we want this?
Well, let’s say there was a bright flash of light - maybe from lightning.
That will actually cause a voltage spike in a pyroelectric material because that visible light also becomes heat when it’s absorbed by it.
But we don’t want the sensor to react to that.
Thanks to the opposing polarity of the crystals it won’t.
If the entire sensor area is heated uniformly,
the equal and opposite voltages produced in the two halves of the pyroelectric element cancel each other out.
But…
If it’s only partially heated, then only one crystal produces voltage while the other doesn’t.
That means there’s an imbalance, so there’s a voltage potential across the entire structure.
And, since that structure is connected across ground and the gate of the transistor,
that difference in heat (and thus difference in potential) will trigger the FET and it will in turn produce a blip on the signal pin.
Which brings us back to the lens.
I mean, lenses.
If I remove this and we look at the backside, you’ll see that this is actually a bunch of Fresnel lenses.
Counting each section with a circle bit as one lens means there are twenty-eight lenses in total.
Unfortunately because this is designed to bend infrared light and not visible light
I can’t demonstrate what this lens is actually doing all that well.
But if I stick my phone’s flashlight behind it at roughly the same position the crystals sit,
you might be able to see that only one section of the lens lights up brightly,
and which section lights up changes as I move the camera around.
Of course, in practice, this is designed to collect light and focus it on the sensor
so what I’m demonstrating here is backwards.
But hopefully this helps you understand that each section of this lens is looking at a narrow slice of what’s in front of it.
And what goes in front of it?
You!
The infrared light your body is emitting will be collected by these lenses
and projected onto the inside surface of the enclosure as a series of fuzzy spots.
Since it’s infrared light, wherever those spots land heats up just a tiny bit.
And here’s the key: as you move in front of the lenses, those fuzzy spots of infrared light will move, too.
And some of them will end up sweeping across the crystal face, heating one side first, and then the other.
That temperature imbalance as the warm spot sweeps across means there’s a voltage imbalance in the crystal,
and that imbalance is what triggers the transistor.
With each lens collecting light from a small slice of its field of view, these sweeps of IR across the sensor repeat as you continue moving.
Do you understand how that works?
It's tough because I can’t show you this but
I can show you stock footage of a disco ball!
As the ball turns (this clip is only seven seconds long, so it’s gonna loop a lot)
as the ball turns (this clip is only sev…
sorry couldn’t resist).
As the ball turns, thanks to the fog machine in the room, we can see the moving beams of light that sweep across the space.
The same thing would happen if the ball were motionless but the light shining on it was moving around the ball.
And if we look at the walls of the room, you’ll see that those spots of light are sweeping across the walls.
This motion sensor is basically exactly that, but in reverse.
The lens is collecting your body heat and creating hot spots inside this enclosure, focused on the sensor.
As you move in front of this thing, those spots move, too.
When they sweep across the two halves of the pyroelectric crystal, it generates enough voltage to trigger the transistor and produce a signal blip.
Then, the electronics inside the device will… do whatever it is they’re supposed to do.
And by the way, infrared motion sensors can be more like disco balls than you may realize.
When the front face of one of these looks uniform rather than segmented, sometimes it isn’t a lens.
Instead it might be a simple window that’s transparent to infrared,
and behind it is a segmented mirror focusing and reflecting light onto the pyroelectric sensor.
Those mirror segments reflect your body heat onto the face of the crystal,
and just like the segmented lens, the spots of heat your body generates on the crystal move across it as you move around.
A sweep across produces a voltage imbalance, which triggers the FET, and the electronics react accordingly.
Speaking of electronics, this module is the kind of module you typically find on an outdoor floodlight.
And it has a distance adjustment.
These knobs turn potentiometers on the board: one for the time the light should stay on after being triggered
and the other labeled distance.
What that distance adjustment does is change how many signal blips from the sensor are required in a given time for the module to interpret movement.
Set at its furthest distance, it may react to just a couple of blips.
But you can dull its sensitivity by requiring the logic to see more blips from the sensor before it switches the lights on.
How does that change the distance it sees?
You probably noticed already that some of the lens elements are smaller and they’re aimed in different directions.
The smaller lenses at the bottom won’t produce as bright of an infrared spot on the inside as their larger neighbors,
and since they’re aimed in slightly different directions,
you have to be closer to this (with your body taking up more of its angular view) for those lens segments to trigger the sensor.
So, if you require more sensor blips in a given period to trigger this,
the thing it’s reacting to needs to be closer to it so it’s seen by more of the lens elements and causes more IR sweeps and thus more signal blips more quickly.
Of course, there are plenty of other designs you can play with, but like everything in life, there are tradeoffs.
The golf ball lookin' lens on this solar light, since it’s a hemisphere, is able to detect movement across a wider field of view.
You often see this kind of sensor on ceilings to detect room occupancy.
But since each lens element is very small,
you have to be pretty close to this for your body heat to affect the pyroelectric crystal.
That gives it a limited detection range, and since the lens elements are mostly uniform,
while you could in theory adjust its sensitivity that won’t correspond as nicely to distance as it does with this design.
You can also use the lens elements and their size to calibrate how large of a living creature you want this to react to.
Lots of home security systems have motion sensors that don’t react to pets,
and one way that's is accomplished is by using lens elements that are simply too small to generate enough heat on the crystal
unless it's a human-sized thing walking in front of it.
It may also use smaller lens elements for areas facing the floor.
Since the actual sensor in these is so simple, tweaks to the lens and careful calibration is really the name of the game here.
And speaking of names, we've reached the end of the video.
And as you might have noticed, at the end of every video
(well almost every video sometimes I’m lazy)
this scrolling list of names appears.
These are some of the lovely people who are supporting my work via Patreon.
I haven’t really talked about Patreon in a long time because, to be honest, I’m doing just fine.
But in the video I just made where I was fawning over awnings, it was dawning on some folks that I’ve never done a sponsored segment or ad read.
And that’s true!
I’ve never explicitly said that since I don’t like tooting my own horn, and also that's a weird thing to brag about:
it's not like I begrudge anyone for doing ad reads.
Especially if they’re funny.
But truly, the reason I'm not doing that is these folks!
I consider myself very lucky that I don’t have to read words somebody at a PR firm wrote for me,
and so long as I can keep going as I am now, I won’t.
So as the jazz fades in, I want to give a heartfelt thanks not just to the people you see here but everyone who supports my work on Patreon.
I’ve got a lot of cool plans lined up and they’re all made possible by people like you.
And thank you!
What is this, PBS?
♫ pyroelecrtrically smooth jazz ♫
But look at how all its… beh.
It may be gallium nitride but it could be something else.
Pyroelectricity is exhibited in… a lot.
What? What am I doing?
STOP CHANGIN’ THE WORDS!
And what goes in front of it?
[confusion]
Oh.
Well that’s a problem.
Are you gon… are you gonna stop?
If you… I need you to stay… I need you to not do that.
And one way this is accomplished is by using smalllllllll what?
When it lands on the stuff...
Well I skipped a skipped some words.
oops!
Speaking of oops, I'm sitting at my desk with the top half of the flood light sensor enclosure and there's a little mirror in there I didn't show you!
It's angled to help the IR coming in from the extreme side areas of the lens make it onto the sensor.
And it looks like it's also throwing the light coming up from the small segments at the bottom back downward.
Neat.